// 登陆
function login() {
    var username = $("#username").val();
    var password = $("#password").val();
    $.ajax({
        type: 'get',
        url: "/login",
        data:{
            "username":username,
            "password":password
        },
        dataType:"json",
        async:false,
        success:function (data) {
            window.location.href = "/every/success";
        }
    })
}

// 注册
function regist() {
    var username = $("#username").val();
    var password = $("#password").val();
    $.ajax({
        type: 'get',
        url: "/regist",
        data:{
            "username":username,
            "password":password
        },
        dataType:"json",
        success:function (data) {
            alert(data.message);
        },
        error: function () {
            alert("225556");
        }
    })
}